package com.ksr.logistics.mapper;

import com.ksr.logistics.pojo.BaseData;
import com.ksr.logistics.pojo.BaseDataExample;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface BaseDataMapper {
    int deleteByPrimaryKey(Long baseId);

    int insert(BaseData record);

    int insertSelective(BaseData record);

    List<BaseData> selectByExample(BaseDataExample example);

    BaseData selectByPrimaryKey(Long baseId);

    int updateByPrimaryKeySelective(BaseData record);

    int updateByPrimaryKey(BaseData record);

    @Select("SELECT * FROM t_base_data WHERE parent_id in " +
            "(SELECT base_id from t_base_data WHERE base_name=#{name})")
//    @Results({
//        @Result(id = true,column = "base_id",property = "baseId"),
//        @Result(column = "base_name",property = "baseName"),
//        @Result(column = "base_desc",property = "baseDesc"),
//        @Result(column = "parent_id",property = "parentId")
//    })
    List<BaseData> selBaseDataByParentName(String name);

}